package indi.zhifa.study2024.generaltest.controller.consign;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import indi.zhifa.core.common.web.entity.ann.ZhiFaRestController;
import indi.zhifa.study2024.generaltest.gen.busy.consign.po.GenConsignEntity;
import indi.zhifa.study2024.generaltest.logic.shardingTest.consign.IConsignService;
import indi.zhifa.study2024.generaltest.logic.shardingTest.consign.entity.request.ConsignAddRequest;
import indi.zhifa.study2024.generaltest.logic.shardingTest.consign.entity.request.ConsignPageRequest;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

@Slf4j
@Validated
@RequiredArgsConstructor
@RequestMapping(value = "/api/test/class008/hello")
@ZhiFaRestController
@Tag(name = "销售单测试")
public class ConsignController {

    private final IConsignService mConsignService;

    @Operation(summary = "添加销售单")
    @PostMapping("/consign/add")
    GenConsignEntity addConsign(@RequestBody ConsignAddRequest pConsignAddRequest){
        return mConsignService.addConsign(pConsignAddRequest);
    }

    @Operation(summary = "销售单分页")
    @PostMapping("/consign/page")
    Page<GenConsignEntity> page(@RequestBody ConsignPageRequest pConsignPageRequest){
        return mConsignService.page(pConsignPageRequest);
    }
}
